import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-04-20
 * Time: 15:14
 */
class Node{
    int val;
    Node next;

    public Node(int val) {
        this.val = val;
        this.next = null;
    }
}
public class test0 {
    public static void main(String[] args) {
        new Object();
        Scanner scanner = new Scanner(System.in);
        int n =scanner.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i]=scanner.nextInt();
        }
        fanZhuan(arr,scanner.nextInt()-1,scanner.nextInt()-1);

        Node head = zhuanList(arr);
        Node node;
        for (node = head; node.next != null; node = node.next) {
            System.out.print(node.val + " ");
        }
        System.out.print(node.val);
    }

    private static Node zhuanList(int[] arr) {
        Node head = new Node(-1);
        Node node = head;
        for (int i = 0; i < arr.length; i++) {
            Node newNode = new Node(arr[i]);
            node.next = newNode;
            node = newNode;
        }
        return head.next;
    }


    private static void fanZhuan(int[] arr, int nextInt, int nextInt1) {

        while (nextInt < nextInt1) {
            int tmp = arr[nextInt];
            arr[nextInt] = arr[nextInt1];
           arr[nextInt1] = tmp;
           nextInt++;
           nextInt1--;
        }
    }

}
